﻿@using Microsoft.Web.Helpers
@model ChangePasswordModel
@{
    Layout = "~/Views/Shared/_LayoutPartial.cshtml";
    ViewBag.ImageUrl = "~/Content/Images/Support_48x48.png";
    ViewBag.Title = Html.Global("RES_CHANGEPWD");
    var web = WebSiteContext.Current.RootWeb;
    var reCaptchaEnabled = web.MasterTools.EnableReCaptcha && (!string.IsNullOrEmpty(web.MasterTools.ReCaptchaPrivateKey)) && (!string.IsNullOrEmpty(web.MasterTools.ReCaptchaPublicKey));
    if (reCaptchaEnabled)
    {
        ReCaptcha.PrivateKey = web.MasterTools.ReCaptchaPrivateKey;
        ReCaptcha.PublicKey = web.MasterTools.ReCaptchaPublicKey;
    }
}
@using (Html.BeginForm("ChangePassword","Account"))
{
@*    @{ Html.EnableClientjQueryValidation(); }*@
    <div style="padding: 20px;">
        <div>
            @Html.ValidationSummary()
            <p>
                @Html.Global("RES_CHANGEPWDFROM")
            </p>
            <p>
                @string.Format(Html.Global("ChangePassword_NewPasswordLength"), ViewData["PasswordLength"])
            </p>
        </div>
        <table cellpadding="5px;" cellspacing="5px">
            <tr>
                <td>
                    <label for="OldPassword">
                        @Html.Global("RES_OLDPWD")
                    </label>
                </td>
                <td>
                    @Ajax.Dna().Password("OldPassword").Value(Model != null ? Model.OldPassword : "").GetHtml()
                    @Html.ValidationMessageFor(m => m.OldPassword)
                </td>
            </tr>
            <tr>
                <td>
                    <label for="NewPassword">
                        @Html.Global("RES_NEWPWD")
                    </label>
                </td>
                <td>
                    @Ajax.Dna().Password("NewPassword").GetHtml()
                    @Html.ValidationMessageFor(m => m.NewPassword)
                </td>
            </tr>
            <tr>
                <td>
                    <label for="ConfirmPassword">
                        @Html.Global("RES_CONFIRMPWD")
                    </label>
                </td>
                <td>
                    @Ajax.Dna().Password("ConfirmPassword").GetHtml()
                    @Html.ValidationMessageFor(m => m.ConfirmPassword)
                </td>
            </tr>
            @if (reCaptchaEnabled)
            {
                <tr>
                    <td colspan="2">
                        @ReCaptcha.GetHtml(theme: "clean")
                    </td>
                </tr>
            }
            <tr>
                <td colspan="2">
                    @Ajax.Submit(Html.Global("RES_CHANGEPWD"))
                </td>
            </tr>
        </table>
    </div>
}
